package com.hz.sdka.commona;

import android.content.Context;

public class SDKContext {
    private static SDKContext instance;
    private boolean isInit;
    private static Context mContext;

    public synchronized static SDKContext getInstance() {
        if (instance == null) {
            synchronized (SDKContext.class) {
                instance = new SDKContext();
            }
        }
        return instance;
    }

    public void setContext(Context context) {
        mContext = context;
    }

    public Context getContext() {
        return mContext;
    }


    public void init(final Context context) {
        if (!isInit) {
            isInit = true;
            final Context applicationContext = context.getApplicationContext();
            setContext(applicationContext);
        }
    }

}
